
arraypoint.o:     file format elf64-littleaarch64


Disassembly of section .text:

0000000000000000 <v>:
	float a3[3]; float 数组,有3个元素，sizeof(float) * 3 = 12 个字节

	char a6[3]; char 数组,有3个元素，sizeof(char) * 3 = 3 个字节.
*/
void v()
{
   0:	a9bc7bfd 	stp	x29, x30, [sp, #-64]!
   4:	910003fd 	mov	x29, sp
	char *p[5];
	
	printf("sizeof(*p[5]) = %d %d %d\n", sizeof(*p[4]), sizeof(p[4]), sizeof(p));	// 1 4 20
   8:	90000000 	adrp	x0, 0 <v>
   c:	91000000 	add	x0, x0, #0x0
  10:	d2800503 	mov	x3, #0x28                  	// #40
  14:	d2800102 	mov	x2, #0x8                   	// #8
  18:	d2800021 	mov	x1, #0x1                   	// #1
  1c:	94000000 	bl	0 <printf>
}
  20:	d503201f 	nop
  24:	a8c47bfd 	ldp	x29, x30, [sp], #64
  28:	d65f03c0 	ret

000000000000002c <array>:

int array(void)
{
  2c:	a9bd7bfd 	stp	x29, x30, [sp, #-48]!
  30:	910003fd 	mov	x29, sp
	int zippo[4][2] = { {2,4}, {6, 8}, {1, 3}, {5, 7} };
  34:	910043a0 	add	x0, x29, #0x10                 ; x0 = stack point
  38:	90000001 	adrp	x1, 0 <v>
  3c:	91000021 	add	x1, x1, #0x0                    ; x1 = variable address
  40:	4c40a020 	ld1	{v0.16b, v1.16b}, [x1]          ; v0, v1 <--- x1
  44:	4c00a000 	st1	{v0.16b, v1.16b}, [x0]          ; v0, v1 ---> x0

	printf(" zippo = %p\t, zippo + 1 = %p  %p\n", 	zippo, zippo + 1, &zippo[1][0]); // zippo + 1 换到下一行的首地址
  48:	910043a0 	add	x0, x29, #0x10 ; zippo
  4c:	91002000 	add	x0, x0, #0x8   ; x0 = zippo + 8
  50:	910043a1 	add	x1, x29, #0x10 ; x1 = zippo
  54:	91002022 	add	x2, x1, #0x8   ; x2 = zippo + 8
  58:	910043a5 	add	x5, x29, #0x10 ; x5 = zippo
  5c:	90000001 	adrp	x1, 0 <v>  ; x1 = parameter
  60:	91000024 	add	x4, x1, #0x0   ; x4 = parameter
  64:	aa0203e3 	mov	x3, x2         ; x3 = zippo+8
  68:	aa0003e2 	mov	x2, x0         ; x2 = zippo+8
  6c:	aa0503e1 	mov	x1, x5         ; x1 = zippo
  70:	aa0403e0 	mov	x0, x4         ; x0 = parameter
  74:	94000000 	bl	0 <printf>
	printf(" zippo[0] = %p\t, zippo[0] + 1 = %p\n", zippo[0], zippo[0] + 1);		 // zippo[0] + 1 第一列的第二个元素地址
  78:	910043a0 	add	x0, x29, #0x10 ; x0 = zippo
  7c:	91001000 	add	x0, x0, #0x4   ; x0 = zippo+4
  80:	910043a4 	add	x4, x29, #0x10 ; x4 = zippo
  84:	90000001 	adrp	x1, 0 <v>  ; x1 = parameter
  88:	91000023 	add	x3, x1, #0x0   ; x3 = parameter
  8c:	aa0003e2 	mov	x2, x0         ; x2 = zippo+4
  90:	aa0403e1 	mov	x1, x4         ; x1 = zippo
  94:	aa0303e0 	mov	x0, x3         ; x0 = parameter
  98:	94000000 	bl	0 <printf>
	printf(" *zippo = %p\t, *zippo + 1 = %p\n\n", 	*zippo, *zippo + 1);			 // *zippo + 1 第一列的第二个元素地址
  9c:	910043a0 	add	x0, x29, #0x10 ; x0 = zippo
  a0:	91001000 	add	x0, x0, #0x4   ; x0 = zippo + 4
  a4:	910043a4 	add	x4, x29, #0x10 ; x4 = zippo
  a8:	90000001 	adrp	x1, 0 <v>  ; x1 = parameter
  ac:	91000023 	add	x3, x1, #0x0   ; x3 = parameter
  b0:	aa0003e2 	mov	x2, x0         ; x2 = zippo + 4
  b4:	aa0403e1 	mov	x1, x4         ; x1 = zippo
  b8:	aa0303e0 	mov	x0, x3         ; x0 = parameter
  bc:	94000000 	bl	0 <printf>
	printf(" &zippo = %p\n\n", 	&zippo);
  c0:	910043a1 	add	x1, x29, #0x10 ; x1 = zippo
  c4:	90000000 	adrp	x0, 0 <v>
  c8:	91000000 	add	x0, x0, #0x0 ; x0 = parameter
  cc:	94000000 	bl	0 <printf>
	
	printf(" zippo[0][0] = %d\n", 	zippo[0][0]);	// 2
  d0:	910043a0 	add	x0, x29, #0x10          ; x0 = zippo
  d4:	b9400001 	ldr	w1, [x0]                ; w1 = **zippo
  d8:	90000000 	adrp	x0, 0 <v>
  dc:	91000000 	add	x0, x0, #0x0
  e0:	94000000 	bl	0 <printf>
	printf(" *zippo[0] = %d\n", 	*zippo[0]);	// 2
  e4:	910043a0 	add	x0, x29, #0x10        ; x0 = zippo
  e8:	b9400001 	ldr	w1, [x0]              ; w1 = **zippo
  ec:	90000000 	adrp	x0, 0 <v>
  f0:	91000000 	add	x0, x0, #0x0
  f4:	94000000 	bl	0 <printf>
	printf(" **zippo = %d\n", 	**zippo);	// 2
  f8:	910043a0 	add	x0, x29, #0x10  ; x0 = zippo
  fc:	b9400001 	ldr	w1, [x0]        ; w1 = **zippo
 100:	90000000 	adrp	x0, 0 <v>
 104:	91000000 	add	x0, x0, #0x0
 108:	94000000 	bl	0 <printf>
	printf(" zippo[2][1] = %d\n", 	zippo[2][1]);	// 3
 10c:	910043a0 	add	x0, x29, #0x10          ; x0 = zippo
 110:	b9401401 	ldr	w1, [x0, #20]           ; w1 = zippo[2][1]
 114:	90000000 	adrp	x0, 0 <v>
 118:	91000000 	add	x0, x0, #0x0
 11c:	94000000 	bl	0 <printf>
	printf(" *(*(zippo + 2) + 1) = %d\n", 	* ( * (zippo + 2) + 1));	// 3
 120:	910043a0 	add	x0, x29, #0x10                             ; x0 = zippo
 124:	91005000 	add	x0, x0, #0x14                              ; x0 = zippo + 14
 128:	b9400001 	ldr	w1, [x0]                                   ; w1 = zippo[2][1]
 12c:	90000000 	adrp	x0, 0 <v>
 130:	91000000 	add	x0, x0, #0x0
 134:	94000000 	bl	0 <printf>

	return 0;
 138:	52800000 	mov	w0, #0x0                   	// #0

}
 13c:	a8c37bfd 	ldp	x29, x30, [sp], #48
 140:	d65f03c0 	ret

0000000000000144 <array_point>:

int array_point(void)
{
 144:	a9ba7bfd 	stp	x29, x30, [sp, #-96]!
 148:	910003fd 	mov	x29, sp
	int zippo[4][2] = { {2,4}, {6, 8}, {1, 3}, {5, 7} };
 14c:	9100e3a0 	add	x0, x29, #0x38                 ; x0 = stack point
 150:	90000001 	adrp	x1, 0 <v>                  ; x1 = variable
 154:	91000021 	add	x1, x1, #0x0                   ; x1 = variable+0
 158:	4c40a020 	ld1	{v0.16b, v1.16b}, [x1]         ; v0,v1 <--- x1
 15c:	4c00a000 	st1	{v0.16b, v1.16b}, [x0]         ; v0,v1 ---> x0
	int (*pz)[2];
	int *pp[4];

	pz = zippo;
 160:	9100e3a0 	add	x0, x29, #0x38 ; zippo
 164:	f9002fa0 	str	x0, [x29, #88] ; pz
	pp = zippo[0][0];	// int *[4] from type int
	pp = &zippo[0][0];	// int *[4] from type int *
	pp = &zippo[0];		// int *[4] from type int (*)[2]
	pp = zippo[0];		// int *[4] from type int
*/
	pp[0] = &zippo[0];	  // warning 
 168:	910063a0 	add	x0, x29, #0x18 ; x0 = pp
 16c:	9100e3a1 	add	x1, x29, #0x38 ; x1 = zippo
 170:	f9000001 	str	x1, [x0]       ; pp[0] = &zippo[0]
	pp[0] = zippo[0];
 174:	910063a0 	add	x0, x29, #0x18 ; pp
 178:	9100e3a1 	add	x1, x29, #0x38 ; zippo
 17c:	f9000001 	str	x1, [x0]       ; pp = zippo
	pp[0] = zippo[0][0];	// warning
 180:	9100e3a0 	add	x0, x29, #0x38 ; zippo
 184:	b9400000 	ldr	w0, [x0]       ; *zippo
 188:	93407c00 	sxtw	x0, w0     ; x0 extend w0
 18c:	aa0003e1 	mov	x1, x0         ; x1 = zippo
 190:	910063a0 	add	x0, x29, #0x18 ; pp
 194:	f9000001 	str	x1, [x0]       ; *pp
	pp[0] = &zippo[0][0];
 198:	910063a0 	add	x0, x29, #0x18 ; pp
 19c:	9100e3a1 	add	x1, x29, #0x38 ; zippo
 1a0:	f9000001 	str	x1, [x0]
	

	printf("&zippo = %p : %p\n", &zippo, &zippo[1][0]);	
 1a4:	9100e3a0 	add	x0, x29, #0x38                ; x0 = zippo
 1a8:	91002002 	add	x2, x0, #0x8                  ; x2 = zippo + 8
 1ac:	9100e3a1 	add	x1, x29, #0x38                ; x1 = zippo
 1b0:	90000000 	adrp	x0, 0 <v>                 ; x0 = parameter
 1b4:	91000000 	add	x0, x0, #0x0                  ; x0 = parameter + 0
 1b8:	94000000 	bl	0 <printf>
	printf(" pz = %p\t, pz + 1 = %p\n", 		pz, pz + 1);		// 换到下一行的首地址
 1bc:	f9402fa0 	ldr	x0, [x29, #88]                     ; x0 = pz
 1c0:	91002001 	add	x1, x0, #0x8                       ; x1 = pz + 8
 1c4:	90000000 	adrp	x0, 0 <v>                      ; parameter
 1c8:	91000000 	add	x0, x0, #0x0                       ; x0 = parameter
 1cc:	aa0103e2 	mov	x2, x1                             ; x2 = pz+8
 1d0:	f9402fa1 	ldr	x1, [x29, #88]                     ; x1 = pz
 1d4:	94000000 	bl	0 <printf>
	printf(" pz[0] = %p\t, pz[0] + 1 = %p\n", 	pz[0], pz[0] + 1);	// 第一列的第二个元素地址
 1d8:	f9402fa0 	ldr	x0, [x29, #88]                           ; pz
 1dc:	91001001 	add	x1, x0, #0x4                             ; pz + 4 
 1e0:	90000000 	adrp	x0, 0 <v>
 1e4:	91000000 	add	x0, x0, #0x0 ; x0 = parmaeter
 1e8:	aa0103e2 	mov	x2, x1       ; x2 = pz+4
 1ec:	f9402fa1 	ldr	x1, [x29, #88] ; pz
 1f0:	94000000 	bl	0 <printf>
	printf(" *pz = %p\t, *pz + 1 = %p\n", 		*pz, *pz + 1);		// 第一列的第二个元素地址
 1f4:	f9402fa0 	ldr	x0, [x29, #88]                       ; pz
 1f8:	91001001 	add	x1, x0, #0x4                         ; pz + 4
 1fc:	90000000 	adrp	x0, 0 <v>
 200:	91000000 	add	x0, x0, #0x0 ; x0 = parameter
 204:	aa0103e2 	mov	x2, x1       ; x2 = pz + z
 208:	f9402fa1 	ldr	x1, [x29, #88] ; x1 = pz
 20c:	94000000 	bl	0 <printf>
	printf(" pz[1] = %p\n\n", 		pz[1]);							// 换到下一行的首地址
 210:	f9402fa0 	ldr	x0, [x29, #88]    ; x0 = pz
 214:	91002001 	add	x1, x0, #0x8      ; x1 = pz + 8
 218:	90000000 	adrp	x0, 0 <v>
 21c:	91000000 	add	x0, x0, #0x0
 220:	94000000 	bl	0 <printf>
	
	printf(" pz[0][0] = %d\n", 			pz[0][0]);	// 2
 224:	f9402fa0 	ldr	x0, [x29, #88]           ; pz
 228:	b9400001 	ldr	w1, [x0]                 ; **pz
 22c:	90000000 	adrp	x0, 0 <v>
 230:	91000000 	add	x0, x0, #0x0
 234:	94000000 	bl	0 <printf>
	printf(" *pz[0] = %d\n", 			*pz[0]);	// 2
 238:	f9402fa0 	ldr	x0, [x29, #88]         ; x0 = pz
 23c:	b9400001 	ldr	w1, [x0]               ; pz[0][0]
 240:	90000000 	adrp	x0, 0 <v>
 244:	91000000 	add	x0, x0, #0x0
 248:	94000000 	bl	0 <printf>
	printf(" **pz = %d\n", 				**pz);		// 2
 24c:	f9402fa0 	ldr	x0, [x29, #88]       ; pz
 250:	b9400001 	ldr	w1, [x0]             ; pz[0][0]
 254:	90000000 	adrp	x0, 0 <v>
 258:	91000000 	add	x0, x0, #0x0
 25c:	94000000 	bl	0 <printf>
	printf(" pz[2][1] = %d\n",			pz[2][1]);	// 3
 260:	f9402fa0 	ldr	x0, [x29, #88]           ; x0 = pz
 264:	91004000 	add	x0, x0, #0x10            ; x0 = pz + 16
 268:	b9400401 	ldr	w1, [x0, #4]             ; w1 = pz[2][1]
 26c:	90000000 	adrp	x0, 0 <v>
 270:	91000000 	add	x0, x0, #0x0
 274:	94000000 	bl	0 <printf>
	printf(" *(*(pz + 2) + 1) = %d\n", 		* ( * (pz + 2) + 1) );	// 3
 278:	f9402fa0 	ldr	x0, [x29, #88]                           ; x0 = pz
 27c:	91004000 	add	x0, x0, #0x10                            ; x0 = pz + 16
 280:	91001000 	add	x0, x0, #0x4                             ; x0 = pz+16+4
 284:	b9400001 	ldr	w1, [x0]                                 ; *(*(pz+2)+1)
 288:	90000000 	adrp	x0, 0 <v>
 28c:	91000000 	add	x0, x0, #0x0
 290:	94000000 	bl	0 <printf>

	return 0;
 294:	52800000 	mov	w0, #0x0                   	// #0

}
 298:	a8c67bfd 	ldp	x29, x30, [sp], #96
 29c:	d65f03c0 	ret

00000000000002a0 <evaluate>:

void evaluate()
{
 2a0:	d10143ff 	sub	sp, sp, #0x50
	int ar1[2][3];
	int ar2[3][2];
	
	int **p2;

	pt = &ar1[0][0];
 2a4:	910083e0 	add	x0, sp, #0x20 ; ar
 2a8:	f9001fe0 	str	x0, [sp, #56] ; pt
	pt = ar1[0];
 2ac:	910083e0 	add	x0, sp, #0x20 ; ar1
 2b0:	f9001fe0 	str	x0, [sp, #56] ; pt
	pt = ar1;	// warning: assignment from incompatible pointer type
 2b4:	910083e0 	add	x0, sp, #0x20 ; ar1
 2b8:	f9001fe0 	str	x0, [sp, #56] ; pt
	
	pa = ar1;
 2bc:	910083e0 	add	x0, sp, #0x20 ; ar1
 2c0:	f90027e0 	str	x0, [sp, #72] ; pa
	pa = ar2;	// warning: assignment from incompatible pointer type
 2c4:	910023e0 	add	x0, sp, #0x8 ; ar2
 2c8:	f90027e0 	str	x0, [sp, #72] ; pa
	
	p2 = &pt;
 2cc:	9100e3e0 	add	x0, sp, #0x38 ; pt
 2d0:	f90023e0 	str	x0, [sp, #64] ; p2
	*p2 = ar1[0];
 2d4:	f94023e0 	ldr	x0, [sp, #64] ; x0 = p2
 2d8:	910083e1 	add	x1, sp, #0x20 ; x1 = ar1
 2dc:	f9000001 	str	x1, [x0]      ; p2 = ar1
	*p2 = ar2[0];
 2e0:	f94023e0 	ldr	x0, [sp, #64] ; p2
 2e4:	910023e1 	add	x1, sp, #0x8  ; ar2
 2e8:	f9000001 	str	x1, [x0]      ; p2=ar2
	p2 = ar2;	// warning: assignment from incompatible pointer type
 2ec:	910023e0 	add	x0, sp, #0x8 ; ar2
 2f0:	f90023e0 	str	x0, [sp, #64] ; p2
}
 2f4:	d503201f 	nop
 2f8:	910143ff 	add	sp, sp, #0x50
 2fc:	d65f03c0 	ret

0000000000000300 <_tmain>:
	指针的指针           char **c;								char **c;               不改变

*/

int _tmain(int argc, char * argv[]) 
{     
 300:	d10243ff 	sub	sp, sp, #0x90
 304:	b9000fe0 	str	w0, [sp, #12]
 308:	f90003e1 	str	x1, [sp]
	
	int * ptr;     
	
	// ptr1是一个指向 int [3] 的指针，即ptr的类型和&arr1的类型是一样的，注意：arr1指向的内存区域定长     

	int ptr1[3][3] = {{1,2,3},{1,2,3},{1,2,3}};     
 30c:	90000000 	adrp	x0, 0 <v>
 310:	91000001 	add	x1, x0, #0x0 ; x1 = parameter
 314:	9100a3e0 	add	x0, sp, #0x28 ; x0 = ptr1
 318:	a9400c22 	ldp	x2, x3, [x1]  ; x2, x3 <--- x1
 31c:	a9000c02 	stp	x2, x3, [x0]  ; x2, x3 ---> x0
 320:	a9410c22 	ldp	x2, x3, [x1, #16] ; x2, x3 <--- x1+16
 324:	a9010c02 	stp	x2, x3, [x0, #16] ; x2, x3 ---> x0+16
 328:	b9402021 	ldr	w1, [x1, #32]     ; w1 = x1 + 32
 32c:	b9002001 	str	w1, [x0, #32]     ; w1 = x0 + 32

	
	// ptr2是一个指向 int * 的指针，即ptr2的类型和&ptr是一样的，注意：ptr指向的内存区域不定长    
	
	int * ptr2[3] = {arr1,arr2,arr3};     
 330:	9101c3e0 	add	x0, sp, #0x70 ; x0 = arr1
 334:	f9000be0 	str	x0, [sp, #16] ; ptr[0]
 338:	910183e0 	add	x0, sp, #0x60 ; x0 = arr2
 33c:	f9000fe0 	str	x0, [sp, #24] ; ptr[1]
 340:	910143e0 	add	x0, sp, #0x50 ; x0 = arr3
 344:	f90013e0 	str	x0, [sp, #32] ; ptr[2]
	

	// ptr3是一个指向 int [3] 的指针，即ptr3的类型和&arr1的类型是一样的，注意：arr1指向的内存区域定长  
	
	int(* ptr3)[3] = &arr1;     ptr3=ptr1; // 没错，他们的类型相同  
 348:	9101c3e0 	add	x0, sp, #0x70 ; x0 = arr1
 34c:	f90047e0 	str	x0, [sp, #136] ; x0 =ptr3
 350:	9100a3e0 	add	x0, sp, #0x28  ; ptr1
 354:	f90047e0 	str	x0, [sp, #136] ; ptr3
	// ptr4是一个指向 int * 的指针，即ptr4的类型和&ptr是一样的，注意：ptr指向的内存区域不定长  
	
	int ** ptr4;     //ptr4 = &arr1; //error 无法从“int (*)[3]”转换为“int **    
	

	ptr4 = ptr2; // 没错，他们的类型相同  
 358:	910043e0 	add	x0, sp, #0x10 ; ptr2
 35c:	f90043e0 	str	x0, [sp, #128] ; ptr4
	
	// ptr4 = ptr3; // error 无法从“int (*)[3]”转换为“int **     
	
	return 0; 
 360:	52800000 	mov	w0, #0x0                   	// #0
}
 364:	910243ff 	add	sp, sp, #0x90
 368:	d65f03c0 	ret

000000000000036c <main>:

int main()
{
 36c:	a9bf7bfd 	stp	x29, x30, [sp, #-16]!
 370:	910003fd 	mov	x29, sp
	//array();
	array_point();
 374:	94000000 	bl	144 <array_point>
	
	return 0;
 378:	52800000 	mov	w0, #0x0                   	// #0
}
 37c:	a8c17bfd 	ldp	x29, x30, [sp], #16
 380:	d65f03c0 	ret
